{include file="../Public/header.html"}
<script type="text/javascript" src="__PUBLIC__/Js/jquery.SetTableBgColor.js"></script>
<script type="text/javascript" src="__PUBLIC__/Js/dataList.js"></script>
<script type="text/javascript">
var g = '{$smarty.const.GROUP_NAME}';
var m = '{$smarty.const.MODULE_NAME}';
var _hash_ = '{$_hash_}';
<!--{literal}-->
function add(id, name)
{
	if(! confirm('确定要添加吗？')){
		return false;
	}
	var url = "?g="+g+"&m="+m+"&a=add&id="+id+"&name="+encodeURIComponent(name)+"&ajax=1&_hash_="+_hash_;
	$.getJSON(url, function(data){
			if(data.status == 0){
				alert('添加失败');
			}else{
				alert('添加成功');
			}
			_hash_ = data.info;
	});
}

$(document).ready(function(){
	$(".table-list").SetTableBgColor({
            odd:"even",
            even:"",
            selected:"",
            over:""
        });
});
<!--{/literal}-->
</script>
<div class="handle-btns">
	
</div>
<div class="search-box">
</div>
<table cellspacing="0" cellpadding="0" border="0" class="table-list list" id="checkList">
<thead>
<tr>
<th width="30" class="first">ID</th>
<th>分类名称</th>
<th width="100">操作</th>
</tr>
</thead>
<tbody>
<!--{foreach from=$tao_shop_categorys item=item}-->
<tr id="tt-item-{$item.cid}">
<td class="first">{$item.cid}</td>
<td align="left">{$item.name}</td>
<td align="center"><a onclick="add({$item.cid}, '{$item.name}')" href="javascript:;">添加</a></td>
</tr>
<!--{/foreach}-->
</tbody></table>
{include file="../Public/footer.html"}